<% @nav_dispaly_project_label = 1 %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title><%= h html_title %></title>
  <meta name="description" content="<%= Redmine::Info.app_name %>"/>
  <meta name="keywords" content="issue,bug,tracker"/>
  <%= csrf_meta_tag %>
  <%= favicon %>
  <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
  <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
  <%= javascript_heads %>
  <%= heads_for_theme %>
  <%= call_hook :view_layouts_base_html_head %>
  <%= javascript_include_tag "ckeditor/ckeditor.js" %>
  <!-- page specific tags -->
  <%= yield :header_tags -%>
  <link href="../stylesheets/bootstrap/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css"/>
</head>
<!--add by huang-->
<body class="<%= h body_css_classes %>">
<div id="wrapper">
  <div id="wrapper2">
    <div id="wrapper3">
      <%= render :partial => 'layouts/base_header' %>
      <div id="main">
        <div class="top-content">
          <table style="width: 940px;">
            <tr>
              <td class="info_font" style="width: 240px; color: #269AC9"><%= l(:label_osp_community) %></td>
              <td style="width: 290px; color: #269AC9"><strong><%= l(:label_user_location) %> : </strong></td>
              <td rowspan="2">
                <div class="top-content-search" style="float: right;">
                  <%#= form_tag(:controller => 'open_source_projects', :action => "search", :method => :get) do %>
                  <%#= text_field_tag 'name', params[:name], :size => 20 %>
                  <%#= hidden_field_tag 'project_type', params[:project_type] %>
                  <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
                  <%# end %>
                  <%= render :partial => "open_source_projects/search_bar" %>
                </div>
              </td>
            </tr>
            <tr>
              <td style="padding-left: 8px">
                <%= link_to request.host(), :controller => 'open_source_projects', :action => 'welcome' %>
              </td>
              <td><%= link_to l(:field_homepage), home_path %>
                >
                <%= link_to l(:label_osp_community), :controller => 'open_source_projects', :action => 'index' %>
                >
                <%= link_to @open_source_project.name, open_source_project_path(@open_source_project) %>
              </td>
            </tr>
          </table>
        </div>

        <div id="content" style="width: 100%;">
          <div id="project_base_info" style="margin-top: 15px; padding-left: 15px; border:1px solid rgb(225,225,225);">
            <table class="base_info">
              <tr id="project_name">
                <td style="width: 350px; font-size: 20px;">
                  <%= link_to image_tag('../images/avatars/Project/0', :class => 'avatar2', :size => '40x40'),
                              open_source_project_path(@open_source_project) %>
                  <%= link_to @open_source_project.name, open_source_project_path(@open_source_project) %>
                </td>
                <td class="font_index" style="width: 150px;">
                  <%= l(:label_base_osp_view_num) %>:&nbsp
                  <span class="font_aram">
                    <%= short_num (@open_source_project.view_num_ossean.nil?) ? 0 : @open_source_project.view_num_ossean %>
                  </span>
                </td>
                <td class="font_index" style="width: 150px;">
                  <%= l(:label_base_osp_discuss_num) %>:&nbsp
                  <span class="font_aram">
                    <%= short_num (@topics_count.nil?) ? 0 : @topics_count %>
                  </span>
                </td>
                <td class="font_index" style="width: 220px;">
                  <%= l(:label_create_time) %>:&nbsp
                  <span class="font_aram" style="color: rgb(123,123,123);">
                    <%= (@open_source_project.created_time).to_s[0, 10] %>
                  </span>
                </td>
                <td class="font_index" style="width: 420px;">
                	<%= l(:label_osp_source) %>:&nbsp
                	<span class="font_aram" style="color: rgb(123,123,123);">
                    <%= show_project_sources @open_source_project.url %>
                 	</span>
                </td>
              </tr>

            </table>
            <div id="project_desc" class="base_info">
                <span class="project_source" style="font-size: 13px"><%= l(:label_project_overview) %>：</span>
                <%= show_project_descriptions @open_source_project.description, 1 %>
            </div>
            <div id="project_tags" class="base_info" style="margin-bottom: 50px;">
                <%= render :partial => 'tags/tag', :locals => {:obj => @open_source_project, :object_flag => "8"} %>
            </div>
          </div>
          <div id="analysis" style="width: 100%; margin-top: 15px;">
            <%= render_flash_messages %>
            <%= yield %>
            <%= call_hook :view_layouts_base_content %>
            <div style="clear:both;"></div>
          </div>
        </div>
        <%= render :partial => 'layouts/base_footer' %>
      </div>

      <div id="ajax-indicator" style="display:none;">
        <span><%= l(:label_loading) %></span>
      </div>
      <div id="ajax-modal" style="display:none;"></div>
    </div>
  </div>
  <%= call_hook :view_layouts_base_body_bottom %>
</div>
</body>
</html>

<!-- ajax user trace zhangxunhui begin -->
<script type="text/javascript">
	function user_trace_click_project_source_in_detail(source,url,rank,session_id){
		//解析url获取osp_id
		url_now = document.URL;
		str = "open_source_projects/";
		index = url_now.indexOf(str);
		id = url_now.substring(index + str.length);
    	$.ajax({
			contentType: "application/json; charset=utf-8",
			timeout: 5000,
			url: '/user_traces/click_project_source_in_detail?source=' + source + "&url=" + url + "&rank=" + rank + "&osp_id=" + id + "&session_id=" + session_id,
			dataType: "json"
		});
    }
</script>
<!-- ajax user trace zhangxunhui end -->

